#!/bin/sh

if [ -d /var/www/html ]; then
  PHPDIR=/var/www/html/phpBB3
  WEBUID=apache:apache
else
  PHPDIR=/var/www/phpBB3
  WEBUID=www-data:www-data
fi


sudo cp -r root/rcb $PHPDIR
sudo chown -R $WEBUID $PHPDIR/rcb

sudo cp -r root/styles/prosilver/template/rcb $PHPDIR/styles/prosilver/template
sudo chown -R $WEBUID $PHPDIR/styles/prosilver/template/rcb

sudo cp -r root/language/en $PHPDIR/language
sudo chown -R $WEBUID $PHPDIR/language/en

# remove our cached files. This has to be done via a new shell otherwise
# the * does not match anything as we don't initially have rights to
# view the directory

sudo sh -c "rm $PHPDIR/cache/*.php"
